package indi.zhang.simplemqconsumer.service.impl;

import indi.zhang.simplemqconsumer.service.TestAsyncService;
import indi.zhang.ttl.core.ZhangAsync;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
@Async
@Slf4j
public class TestAsyncServiceImpl implements TestAsyncService {
    @Override
    @ZhangAsync
    public void async() {
        log.info("hello");
        try {
            Thread.sleep(2000);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
